import request from '@/utils/request';

/**
 * 获取合作伙伴
 * @returns {Promise<any>}
 */
export const getPartnerData = async (data,page) => {
  const options = {
    params: data
  }
  return request(`/admin/partners?page=` + page,options);
}
/**
 * 添加合作伙伴
 * @returns {Promise<any>}
 */
export const addPartners = async (data) => {
  return request.post('/admin/partners',{data});
}
/**
 * 更新合作伙伴
 * @returns {Promise<any>}
 */
export const updatePartner = async (id,data) => {
  return request.put(`/admin/partners/${id}`,{data});
}
/**
 * 删除合作伙伴
 * @returns {Promise<any>}
 */
export const delPartnerDetail = async (id) => {
  return request.delete(`/admin/partners/${id}`);
}
/**
 * 修改合作伙伴的状态
 * @returns {Promise<any>}
 */
export const editPartnerStatus = async (id) => {
  return request.patch(`/admin/partners/${id}/status`)
}
/**
 * 获取合作伙伴的详情
 * @returns {Promise<any>}
 */
export const getPartnerDetail = async (id) => {
  return request.get(`/admin/partners/${id}`)
}

